let obj1 = {
    a: 1,
    add: function () {
        return this.a + this.b;
    }
};
let obj2 = {
    b: 2
};
// 设置obj2的原型为obj1
Object.setPrototypeOf(obj2, obj1);
obj2.add(); // 输出为：3

/*
pass 1
;; function () {

        enter_scope 1

;;         return this.a + this.b;

        line_num 4
        scope_get_var this,0
        get_field a
        scope_get_var this,0
        get_field b
        add
        return

;;     }

pass 2
;; function () {
;;         return this.a + this.b;

        line_num 4
        get_loc 0: this
        get_field a
        get_loc 0: this
        get_field b
        add
        return

;;     }

./proto.js:3: function: <null>
  locals:
    0: var this
  stack_size: 2
  opcodes:
;; function () {

        push_this
        put_loc0 0: this

;;         return this.a + this.b;

        get_loc0 0: this
        get_field a
        get_loc0 0: this
        get_field b
        add
        return

;;     }

pass 1
        line_num 0
        enter_scope 1
        line_num 1
        object
        line_num 2
        push_i32 1
        define_field a
        line_num 5
        fclosure 0: [bytecode <null>]
        set_name add
        define_field add
        line_num 6
        scope_put_var_init obj1,1
        line_num 7
        object
        line_num 8
        push_i32 2
        define_field b
        line_num 9
        scope_put_var_init obj2,1
        line_num 11
        scope_get_var Object,1
        get_field2 setPrototypeOf
        scope_get_var obj2,1
        scope_get_var obj1,1
        call_method 2
        put_loc 0: "<ret>"
        line_num 12
        scope_get_var obj2,1
        get_field2 add
        call_method 0
        put_loc 0: "<ret>"
        get_loc 0: "<ret>"
        return

pass 2
        check_define_var obj1,128
        check_define_var obj2,128
        line_num 0
        define_var obj1,130
        define_var obj2,130
        line_num 1
        object
        line_num 2
        push_i32 1
        define_field a
        line_num 5
        fclosure 0: [bytecode <null>]
        set_name add
        define_field add
        line_num 6
        put_var_init obj1
        line_num 7
        object
        line_num 8
        push_i32 2
        define_field b
        line_num 9
        put_var_init obj2
        line_num 11
        get_var Object
        get_field2 setPrototypeOf
        get_var obj2
        get_var obj1
        call_method 2
        put_loc 0: "<ret>"
        line_num 12
        get_var obj2
        get_field2 add
        call_method 0
        put_loc 0: "<ret>"
        get_loc 0: "<ret>"
        return

./proto.js:1: function: <eval>
  locals:
    0: var <ret>
  stack_size: 4
  opcodes:
        check_define_var obj1,128
        check_define_var obj2,128
        define_var obj1,130
        define_var obj2,130
        object
        push_1 1
        define_field a
        fclosure8 0: [bytecode <null>]
        set_name add
        define_field add
        put_var_init obj1
        object
        push_2 2
        define_field b
        put_var_init obj2
        get_var Object
        get_field2 setPrototypeOf
        get_var obj2
        get_var obj1
        call_method 2
        put_loc0 0: "<ret>"
        get_var obj2
        get_field2 add
        call_method 0
        set_loc0 0: "<ret>"
        return
 */